﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;

// Token: 0x02000441 RID: 1089
public class Expression : MonoBehaviour
{
	// Token: 0x06001B39 RID: 6969 RVA: 0x000AE9B8 File Offset: 0x000ACBB8
	public void SetCharaTransform(Transform trf)
	{
		this.trfChara = trf;
	}

	// Token: 0x06001B3A RID: 6970 RVA: 0x000AE9C4 File Offset: 0x000ACBC4
	public void Initialize()
	{
		if (null == this.trfChara)
		{
			return;
		}
		this.FindObjectAll(this.dictTrf, this.trfChara);
		Transform transform = null;
		foreach (Expression.ScriptInfo scriptInfo in this.info)
		{
			if (scriptInfo.enableLookAt && scriptInfo.lookAt != null)
			{
				if (!this.dictTrf.TryGetValue(scriptInfo.lookAt.lookAtName, out transform))
				{
					GlobalData.Debug_LogWarning(string.Format("不足 : {0}", scriptInfo.lookAt.lookAtName));
				}
				else
				{
					scriptInfo.lookAt.SetLookAtTransform(transform);
					if (!this.dictTrf.TryGetValue(scriptInfo.lookAt.targetName, out transform))
					{
						GlobalData.Debug_LogWarning(string.Format("不足 : {0}", scriptInfo.lookAt.targetName));
					}
					else
					{
						scriptInfo.lookAt.SetTargetTransform(transform);
						this.dictTrf.TryGetValue(scriptInfo.lookAt.upAxisName, out transform);
						scriptInfo.lookAt.SetUpAxisTransform(transform);
					}
				}
			}
			if (scriptInfo.enableCorrect && scriptInfo.correct != null)
			{
				if (!this.dictTrf.TryGetValue(scriptInfo.correct.correctName, out transform))
				{
					GlobalData.Debug_LogWarning(string.Format("不足 : {0}", scriptInfo.correct.correctName));
				}
				else
				{
					scriptInfo.correct.SetCorrectTransform(transform);
					this.dictTrf.TryGetValue(scriptInfo.correct.referenceName, out transform);
					scriptInfo.correct.SetReferenceTransform(transform);
				}
			}
		}
	}

	// Token: 0x06001B3B RID: 6971 RVA: 0x000AEB64 File Offset: 0x000ACD64
	public void FindObjectAll(Dictionary<string, Transform> _dictTrf, Transform _trf)
	{
		if (!_dictTrf.ContainsKey(_trf.name))
		{
			_dictTrf[_trf.name] = _trf;
		}
		for (int i = 0; i < _trf.childCount; i++)
		{
			this.FindObjectAll(_dictTrf, _trf.GetChild(i));
		}
	}

	// Token: 0x06001B3C RID: 6972 RVA: 0x000AEBB4 File Offset: 0x000ACDB4
	public void EnableCategory(int categoryNo, bool _enable)
	{
		for (int i = 0; i < this.info.Length; i++)
		{
			if (this.info[i].categoryNo == categoryNo)
			{
				this.info[i].enable = _enable;
			}
		}
	}

	// Token: 0x06001B3D RID: 6973 RVA: 0x000AEBFC File Offset: 0x000ACDFC
	public void EnableIndex(int indexNo, bool _enable)
	{
		if (0 <= indexNo && indexNo < this.info.Length)
		{
			this.info[indexNo].enable = _enable;
		}
	}

	// Token: 0x06001B3E RID: 6974 RVA: 0x000AEC24 File Offset: 0x000ACE24
	private void Start()
	{
	}

	// Token: 0x06001B3F RID: 6975 RVA: 0x000AEC28 File Offset: 0x000ACE28
	private void LateUpdate()
	{
		if (this.info == null)
		{
			return;
		}
		if (this.enable)
		{
			foreach (Expression.ScriptInfo scriptInfo in this.info)
			{
				scriptInfo.Update();
			}
		}
	}

	// Token: 0x06001B40 RID: 6976 RVA: 0x000AEC74 File Offset: 0x000ACE74
	private void OnDestroy()
	{
		if (this.info == null)
		{
			return;
		}
		foreach (Expression.ScriptInfo scriptInfo in this.info)
		{
			scriptInfo.Destroy();
		}
	}

	// Token: 0x06001B41 RID: 6977 RVA: 0x000AECB4 File Offset: 0x000ACEB4
	public bool LoadSetting(string assetBundleName, string assetName)
	{
		TextAsset textAsset = CommonLib.LoadAsset<TextAsset>(assetBundleName, assetName, false, "studio00");
		if (null == textAsset)
		{
			GlobalData.Debug_LogError("不可以有");
			return false;
		}
		string text = textAsset.text.Replace("\r", string.Empty);
		string[] collection = text.Split(new char[]
		{
			'\n'
		});
		List<string> list = new List<string>();
		list.AddRange(collection);
		AssetBundleManager.UnloadAssetBundle(assetBundleName, false, null, false);
		return this.LoadSettingSub(list);
	}

	// Token: 0x06001B42 RID: 6978 RVA: 0x000AED2C File Offset: 0x000ACF2C
	public bool LoadSetting(string path)
	{
		List<string> list = new List<string>();
		using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
		{
			using (StreamReader streamReader = new StreamReader(fileStream, Encoding.UTF8))
			{
				while (streamReader.Peek() > -1)
				{
					list.Add(streamReader.ReadLine());
				}
			}
		}
		return this.LoadSettingSub(list);
	}

	// Token: 0x06001B43 RID: 6979 RVA: 0x000AEDBC File Offset: 0x000ACFBC
	public bool LoadSettingSub(List<string> slist)
	{
		if (slist.Count == 0)
		{
			return false;
		}
		string[] array = slist[0].Split(new char[]
		{
			'\t'
		});
		int num = int.Parse(array[0]);
		if (num > slist.Count - 1)
		{
			return false;
		}
		this.info = new Expression.ScriptInfo[num];
		for (int i = 0; i < num; i++)
		{
			array = slist[i + 1].Split(new char[]
			{
				'\t'
			});
			this.info[i] = new Expression.ScriptInfo();
			this.info[i].index = i;
			int num2 = 0;
			this.info[i].categoryNo = int.Parse(array[num2++]);
			this.info[i].enableLookAt = (array[num2++] == "○");
			if (this.info[i].enableLookAt)
			{
				this.info[i].lookAt.lookAtName = array[num2++];
				if ("0" == this.info[i].lookAt.lookAtName)
				{
					this.info[i].lookAt.lookAtName = string.Empty;
				}
				else
				{
					this.info[i].elementName = this.info[i].lookAt.lookAtName;
				}
				this.info[i].lookAt.targetName = array[num2++];
				if ("0" == this.info[i].lookAt.targetName)
				{
					this.info[i].lookAt.targetName = string.Empty;
				}
				this.info[i].lookAt.targetAxisType = (Expression.LookAt.AxisType)Enum.Parse(typeof(Expression.LookAt.AxisType), array[num2++]);
				this.info[i].lookAt.upAxisName = array[num2++];
				if ("0" == this.info[i].lookAt.upAxisName)
				{
					this.info[i].lookAt.upAxisName = string.Empty;
				}
				this.info[i].lookAt.upAxisType = (Expression.LookAt.AxisType)Enum.Parse(typeof(Expression.LookAt.AxisType), array[num2++]);
				this.info[i].lookAt.sourceAxisType = (Expression.LookAt.AxisType)Enum.Parse(typeof(Expression.LookAt.AxisType), array[num2++]);
				this.info[i].lookAt.limitAxisType = (Expression.LookAt.AxisType)Enum.Parse(typeof(Expression.LookAt.AxisType), array[num2++]);
				this.info[i].lookAt.rotOrder = (Expression.LookAt.RotationOrder)Enum.Parse(typeof(Expression.LookAt.RotationOrder), array[num2++]);
				this.info[i].lookAt.limitMin = float.Parse(array[num2++]);
				this.info[i].lookAt.limitMax = float.Parse(array[num2++]);
			}
			else
			{
				num2 += 10;
			}
			this.info[i].enableCorrect = (array[num2++] == "○");
			if (this.info[i].enableCorrect)
			{
				this.info[i].correct.correctName = array[num2++];
				if ("0" == this.info[i].correct.correctName)
				{
					this.info[i].correct.correctName = string.Empty;
				}
				else
				{
					this.info[i].elementName = this.info[i].correct.correctName;
				}
				this.info[i].correct.referenceName = array[num2++];
				if ("0" == this.info[i].correct.referenceName)
				{
					this.info[i].correct.referenceName = string.Empty;
				}
				this.info[i].correct.calcType = (Expression.Correct.CalcType)Enum.Parse(typeof(Expression.Correct.CalcType), array[num2++]);
				this.info[i].correct.rotOrder = (Expression.Correct.RotationOrder)Enum.Parse(typeof(Expression.Correct.RotationOrder), array[num2++]);
				this.info[i].correct.charmRate = float.Parse(array[num2++]);
				this.info[i].correct.useRX = (array[num2++] == "○");
				this.info[i].correct.valRXMin = float.Parse(array[num2++]);
				this.info[i].correct.valRXMax = float.Parse(array[num2++]);
				this.info[i].correct.useRY = (array[num2++] == "○");
				this.info[i].correct.valRYMin = float.Parse(array[num2++]);
				this.info[i].correct.valRYMax = float.Parse(array[num2++]);
				this.info[i].correct.useRZ = (array[num2++] == "○");
				this.info[i].correct.valRZMin = float.Parse(array[num2++]);
				this.info[i].correct.valRZMax = float.Parse(array[num2++]);
			}
		}
		return true;
	}

	// Token: 0x04001E9B RID: 7835
	public Transform trfChara;

	// Token: 0x04001E9C RID: 7836
	public Expression.ScriptInfo[] info;

	// Token: 0x04001E9D RID: 7837
	public bool enable = true;

	// Token: 0x04001E9E RID: 7838
	private Dictionary<string, Transform> dictTrf = new Dictionary<string, Transform>();

	// Token: 0x02000442 RID: 1090
	[Serializable]
	public class LookAt
	{
		// Token: 0x06001B44 RID: 6980 RVA: 0x000AF3B0 File Offset: 0x000AD5B0
		public LookAt()
		{
			this.trfLookAt = null;
			this.trfTarget = null;
			this.trfUpAxis = null;
		}

		// Token: 0x170002AA RID: 682
		// (get) Token: 0x06001B45 RID: 6981 RVA: 0x000AF41C File Offset: 0x000AD61C
		// (set) Token: 0x06001B46 RID: 6982 RVA: 0x000AF424 File Offset: 0x000AD624
		public Transform trfLookAt { get; private set; }

		// Token: 0x170002AB RID: 683
		// (get) Token: 0x06001B47 RID: 6983 RVA: 0x000AF430 File Offset: 0x000AD630
		// (set) Token: 0x06001B48 RID: 6984 RVA: 0x000AF438 File Offset: 0x000AD638
		public Transform trfTarget { get; private set; }

		// Token: 0x170002AC RID: 684
		// (get) Token: 0x06001B49 RID: 6985 RVA: 0x000AF444 File Offset: 0x000AD644
		// (set) Token: 0x06001B4A RID: 6986 RVA: 0x000AF44C File Offset: 0x000AD64C
		public Transform trfUpAxis { get; private set; }

		// Token: 0x06001B4B RID: 6987 RVA: 0x000AF458 File Offset: 0x000AD658
		public void SetLookAtTransform(Transform trf)
		{
			this.trfLookAt = trf;
		}

		// Token: 0x06001B4C RID: 6988 RVA: 0x000AF464 File Offset: 0x000AD664
		public void SetTargetTransform(Transform trf)
		{
			this.trfTarget = trf;
		}

		// Token: 0x06001B4D RID: 6989 RVA: 0x000AF470 File Offset: 0x000AD670
		public void SetUpAxisTransform(Transform trf)
		{
			this.trfUpAxis = trf;
		}

		// Token: 0x06001B4E RID: 6990 RVA: 0x000AF47C File Offset: 0x000AD67C
		public void Update()
		{
			if (null == this.trfTarget || null == this.trfLookAt)
			{
				return;
			}
			Vector3 upVector = this.GetUpVector();
			Vector3 vector = Vector3.Normalize(this.trfTarget.position - this.trfLookAt.position);
			Vector3 vector2 = Vector3.Normalize(Vector3.Cross(upVector, vector));
			Vector3 vector3 = Vector3.Cross(vector, vector2);
			if (this.targetAxisType == Expression.LookAt.AxisType.RevX || this.targetAxisType == Expression.LookAt.AxisType.RevY || this.targetAxisType == Expression.LookAt.AxisType.RevZ)
			{
				vector = -vector;
				vector2 = -vector2;
			}
			Vector3 xvec = Vector3.zero;
			Vector3 yvec = Vector3.zero;
			Vector3 zvec = Vector3.zero;
			switch (this.targetAxisType)
			{
			case Expression.LookAt.AxisType.X:
			case Expression.LookAt.AxisType.RevX:
				xvec = vector;
				if (this.sourceAxisType == Expression.LookAt.AxisType.Y)
				{
					yvec = vector3;
					zvec = -vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevY)
				{
					yvec = -vector3;
					zvec = vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.Z)
				{
					yvec = vector2;
					zvec = vector3;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevZ)
				{
					yvec = -vector2;
					zvec = -vector3;
				}
				break;
			case Expression.LookAt.AxisType.Y:
			case Expression.LookAt.AxisType.RevY:
				yvec = vector;
				if (this.sourceAxisType == Expression.LookAt.AxisType.X)
				{
					xvec = vector3;
					zvec = vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevX)
				{
					xvec = -vector3;
					zvec = -vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.Z)
				{
					xvec = -vector2;
					zvec = vector3;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevZ)
				{
					xvec = vector2;
					zvec = -vector3;
				}
				break;
			case Expression.LookAt.AxisType.Z:
			case Expression.LookAt.AxisType.RevZ:
				zvec = vector;
				if (this.sourceAxisType == Expression.LookAt.AxisType.X)
				{
					xvec = vector3;
					yvec = -vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevX)
				{
					xvec = -vector3;
					yvec = vector2;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.Y)
				{
					xvec = vector2;
					yvec = vector3;
				}
				else if (this.sourceAxisType == Expression.LookAt.AxisType.RevY)
				{
					xvec = -vector2;
					yvec = -vector3;
				}
				break;
			}
			if (this.limitAxisType == Expression.LookAt.AxisType.None)
			{
				this.trfLookAt.rotation = this.LookAtQuat(xvec, yvec, zvec);
			}
			else
			{
				this.trfLookAt.rotation = this.LookAtQuat(xvec, yvec, zvec);
				ConvertRotation.RotationOrder order = (ConvertRotation.RotationOrder)this.rotOrder;
				Quaternion localRotation = this.trfLookAt.localRotation;
				Vector3 vector4 = ConvertRotation.ConvertDegreeFromQuaternion(order, localRotation);
				Quaternion q = Quaternion.Slerp(localRotation, Quaternion.identity, 0.5f);
				Vector3 vector5 = ConvertRotation.ConvertDegreeFromQuaternion(order, q);
				if (this.limitAxisType == Expression.LookAt.AxisType.X)
				{
					if ((vector4.x < 0f && vector5.x > 0f) || (vector4.x > 0f && vector5.x < 0f))
					{
						vector4.x *= -1f;
					}
					vector4.x = Mathf.Clamp(vector4.x, this.limitMin, this.limitMax);
				}
				else if (this.limitAxisType == Expression.LookAt.AxisType.Y)
				{
					if ((vector4.y < 0f && vector5.y > 0f) || (vector4.y > 0f && vector5.y < 0f))
					{
						vector4.y *= -1f;
					}
					vector4.y = Mathf.Clamp(vector4.y, this.limitMin, this.limitMax);
				}
				else if (this.limitAxisType == Expression.LookAt.AxisType.Z)
				{
					if ((vector4.z < 0f && vector5.z > 0f) || (vector4.z > 0f && vector5.z < 0f))
					{
						vector4.z *= -1f;
					}
					vector4.z = Mathf.Clamp(vector4.z, this.limitMin, this.limitMax);
				}
				this.trfLookAt.localRotation = ConvertRotation.ConvertDegreeToQuaternion(order, vector4.x, vector4.y, vector4.z);
			}
		}

		// Token: 0x06001B4F RID: 6991 RVA: 0x000AF8E8 File Offset: 0x000ADAE8
		private Vector3 GetUpVector()
		{
			Vector3 result = Vector3.up;
			if (this.trfUpAxis)
			{
				Expression.LookAt.AxisType axisType = this.upAxisType;
				if (axisType != Expression.LookAt.AxisType.X)
				{
					if (axisType != Expression.LookAt.AxisType.Y)
					{
						if (axisType == Expression.LookAt.AxisType.Z)
						{
							result = this.trfUpAxis.forward;
						}
					}
					else
					{
						result = this.trfUpAxis.up;
					}
				}
				else
				{
					result = this.trfUpAxis.right;
				}
			}
			return result;
		}

		// Token: 0x06001B50 RID: 6992 RVA: 0x000AF960 File Offset: 0x000ADB60
		private Quaternion LookAtQuat(Vector3 xvec, Vector3 yvec, Vector3 zvec)
		{
			float num = 1f + xvec.x + yvec.y + zvec.z;
			if (num == 0f)
			{
				return Quaternion.identity;
			}
			float num2 = Mathf.Sqrt(num) / 2f;
			if (float.IsNaN(num2))
			{
				return Quaternion.identity;
			}
			float num3 = 4f * num2;
			if (num3 == 0f)
			{
				return Quaternion.identity;
			}
			float x = (yvec.z - zvec.y) / num3;
			float y = (zvec.x - xvec.z) / num3;
			float z = (xvec.y - yvec.x) / num3;
			return new Quaternion(x, y, z, num2);
		}

		// Token: 0x04001E9F RID: 7839
		public string lookAtName = string.Empty;

		// Token: 0x04001EA1 RID: 7841
		public string targetName = string.Empty;

		// Token: 0x04001EA3 RID: 7843
		public Expression.LookAt.AxisType targetAxisType = Expression.LookAt.AxisType.Z;

		// Token: 0x04001EA4 RID: 7844
		public string upAxisName = string.Empty;

		// Token: 0x04001EA6 RID: 7846
		public Expression.LookAt.AxisType upAxisType = Expression.LookAt.AxisType.Y;

		// Token: 0x04001EA7 RID: 7847
		public Expression.LookAt.AxisType sourceAxisType = Expression.LookAt.AxisType.Y;

		// Token: 0x04001EA8 RID: 7848
		public Expression.LookAt.AxisType limitAxisType = Expression.LookAt.AxisType.None;

		// Token: 0x04001EA9 RID: 7849
		public Expression.LookAt.RotationOrder rotOrder = Expression.LookAt.RotationOrder.ZXY;

		// Token: 0x04001EAA RID: 7850
		[Range(-180f, 180f)]
		public float limitMin;

		// Token: 0x04001EAB RID: 7851
		[Range(-180f, 180f)]
		public float limitMax;

		// Token: 0x02000443 RID: 1091
		public enum AxisType
		{
			// Token: 0x04001EAD RID: 7853
			X,
			// Token: 0x04001EAE RID: 7854
			Y,
			// Token: 0x04001EAF RID: 7855
			Z,
			// Token: 0x04001EB0 RID: 7856
			RevX,
			// Token: 0x04001EB1 RID: 7857
			RevY,
			// Token: 0x04001EB2 RID: 7858
			RevZ,
			// Token: 0x04001EB3 RID: 7859
			None
		}

		// Token: 0x02000444 RID: 1092
		public enum RotationOrder
		{
			// Token: 0x04001EB5 RID: 7861
			XYZ,
			// Token: 0x04001EB6 RID: 7862
			XZY,
			// Token: 0x04001EB7 RID: 7863
			YXZ,
			// Token: 0x04001EB8 RID: 7864
			YZX,
			// Token: 0x04001EB9 RID: 7865
			ZXY,
			// Token: 0x04001EBA RID: 7866
			ZYX
		}
	}

	// Token: 0x02000445 RID: 1093
	[Serializable]
	public class Correct
	{
		// Token: 0x06001B51 RID: 6993 RVA: 0x000AFA18 File Offset: 0x000ADC18
		public Correct()
		{
			this.trfCorrect = null;
			this.trfReference = null;
		}

		// Token: 0x170002AD RID: 685
		// (get) Token: 0x06001B52 RID: 6994 RVA: 0x000AFA4C File Offset: 0x000ADC4C
		// (set) Token: 0x06001B53 RID: 6995 RVA: 0x000AFA54 File Offset: 0x000ADC54
		public Transform trfCorrect { get; private set; }

		// Token: 0x170002AE RID: 686
		// (get) Token: 0x06001B54 RID: 6996 RVA: 0x000AFA60 File Offset: 0x000ADC60
		// (set) Token: 0x06001B55 RID: 6997 RVA: 0x000AFA68 File Offset: 0x000ADC68
		public Transform trfReference { get; private set; }

		// Token: 0x06001B56 RID: 6998 RVA: 0x000AFA74 File Offset: 0x000ADC74
		public void SetCorrectTransform(Transform trf)
		{
			this.trfCorrect = trf;
		}

		// Token: 0x06001B57 RID: 6999 RVA: 0x000AFA80 File Offset: 0x000ADC80
		public void SetReferenceTransform(Transform trf)
		{
			this.trfReference = trf;
		}

		// Token: 0x06001B58 RID: 7000 RVA: 0x000AFA8C File Offset: 0x000ADC8C
		public void Update()
		{
			if (null == this.trfCorrect || null == this.trfReference)
			{
				return;
			}
			if (this.calcType == Expression.Correct.CalcType.Euler)
			{
				ConvertRotation.RotationOrder order = (ConvertRotation.RotationOrder)this.rotOrder;
				Vector3 vector = ConvertRotation.ConvertDegreeFromQuaternion(order, this.trfCorrect.localRotation);
				Vector3 vector2 = ConvertRotation.ConvertDegreeFromQuaternion(order, this.trfReference.localRotation);
				Quaternion q = Quaternion.identity;
				Vector3 vector3 = Vector3.zero;
				if (this.charmRate != 0f)
				{
					q = Quaternion.Slerp(this.trfReference.localRotation, Quaternion.identity, this.charmRate);
					vector3 = ConvertRotation.ConvertDegreeFromQuaternion(order, q);
				}
				if (this.useRX)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.x), 0f, 90f));
					num = Mathf.Lerp(this.valRXMin, this.valRXMax, num);
					vector.x = vector2.x * num;
					if (this.charmRate != 0f && ((vector2.x < 0f && vector3.x > 0f) || (vector2.x > 0f && vector3.x < 0f)))
					{
						vector.x *= -1f;
					}
				}
				if (this.useRY)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.y), 0f, 90f));
					num = Mathf.Lerp(this.valRYMin, this.valRYMax, num);
					vector.y = vector2.y * num;
					if (this.charmRate != 0f && ((vector2.y < 0f && vector3.y > 0f) || (vector2.y > 0f && vector3.y < 0f)))
					{
						vector.y *= -1f;
					}
				}
				if (this.useRZ)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.z), 0f, 90f));
					num = Mathf.Lerp(this.valRZMin, this.valRZMax, num);
					vector.z = vector2.z * num;
					if (this.charmRate != 0f && ((vector2.z < 0f && vector3.z > 0f) || (vector2.z > 0f && vector3.z < 0f)))
					{
						vector.z *= -1f;
					}
				}
				this.trfCorrect.localRotation = ConvertRotation.ConvertDegreeToQuaternion(order, vector.x, vector.y, vector.z);
			}
			else if (this.calcType == Expression.Correct.CalcType.Quaternion)
			{
				Quaternion localRotation = this.trfCorrect.localRotation;
				if (this.useRX)
				{
					localRotation.x = this.trfReference.localRotation.x * (this.valRXMin + this.valRXMax) * 0.5f;
				}
				if (this.useRY)
				{
					localRotation.y = this.trfReference.localRotation.y * (this.valRYMin + this.valRYMax) * 0.5f;
				}
				if (this.useRZ)
				{
					localRotation.z = this.trfReference.localRotation.z * (this.valRZMin + this.valRZMax) * 0.5f;
				}
				this.trfCorrect.localRotation = localRotation;
			}
		}

		// Token: 0x04001EBB RID: 7867
		public string correctName = string.Empty;

		// Token: 0x04001EBD RID: 7869
		public string referenceName = string.Empty;

		// Token: 0x04001EBF RID: 7871
		public Expression.Correct.CalcType calcType;

		// Token: 0x04001EC0 RID: 7872
		public Expression.Correct.RotationOrder rotOrder = Expression.Correct.RotationOrder.ZXY;

		// Token: 0x04001EC1 RID: 7873
		[Range(0f, 1f)]
		public float charmRate;

		// Token: 0x04001EC2 RID: 7874
		public bool useRX;

		// Token: 0x04001EC3 RID: 7875
		[Range(-1f, 1f)]
		public float valRXMin;

		// Token: 0x04001EC4 RID: 7876
		[Range(-1f, 1f)]
		public float valRXMax;

		// Token: 0x04001EC5 RID: 7877
		public bool useRY;

		// Token: 0x04001EC6 RID: 7878
		[Range(-1f, 1f)]
		public float valRYMin;

		// Token: 0x04001EC7 RID: 7879
		[Range(-1f, 1f)]
		public float valRYMax;

		// Token: 0x04001EC8 RID: 7880
		public bool useRZ;

		// Token: 0x04001EC9 RID: 7881
		[Range(-1f, 1f)]
		public float valRZMin;

		// Token: 0x04001ECA RID: 7882
		[Range(-1f, 1f)]
		public float valRZMax;

		// Token: 0x02000446 RID: 1094
		public enum CalcType
		{
			// Token: 0x04001ECC RID: 7884
			Euler,
			// Token: 0x04001ECD RID: 7885
			Quaternion
		}

		// Token: 0x02000447 RID: 1095
		public enum RotationOrder
		{
			// Token: 0x04001ECF RID: 7887
			XYZ,
			// Token: 0x04001ED0 RID: 7888
			XZY,
			// Token: 0x04001ED1 RID: 7889
			YXZ,
			// Token: 0x04001ED2 RID: 7890
			YZX,
			// Token: 0x04001ED3 RID: 7891
			ZXY,
			// Token: 0x04001ED4 RID: 7892
			ZYX
		}
	}

	// Token: 0x02000448 RID: 1096
	[Serializable]
	public class ScriptInfo
	{
		// Token: 0x06001B5A RID: 7002 RVA: 0x000AFEAC File Offset: 0x000AE0AC
		public void Update()
		{
			if (!this.enable)
			{
				return;
			}
			if (this.enableLookAt && this.lookAt != null)
			{
				this.lookAt.Update();
			}
			if (this.enableCorrect && this.correct != null)
			{
				this.correct.Update();
			}
		}

		// Token: 0x06001B5B RID: 7003 RVA: 0x000AFF08 File Offset: 0x000AE108
		public void UpdateArrow()
		{
		}

		// Token: 0x06001B5C RID: 7004 RVA: 0x000AFF0C File Offset: 0x000AE10C
		public void Destroy()
		{
		}

		// Token: 0x06001B5D RID: 7005 RVA: 0x000AFF10 File Offset: 0x000AE110
		public void DestroyArrow()
		{
		}

		// Token: 0x04001ED5 RID: 7893
		public string elementName = string.Empty;

		// Token: 0x04001ED6 RID: 7894
		public bool enable = true;

		// Token: 0x04001ED7 RID: 7895
		public bool enableLookAt;

		// Token: 0x04001ED8 RID: 7896
		public Expression.LookAt lookAt = new Expression.LookAt();

		// Token: 0x04001ED9 RID: 7897
		public bool enableCorrect;

		// Token: 0x04001EDA RID: 7898
		public Expression.Correct correct = new Expression.Correct();

		// Token: 0x04001EDB RID: 7899
		public int index;

		// Token: 0x04001EDC RID: 7900
		public int categoryNo;
	}
}
